package com.tjhk.demo.taos.util;

import java.util.HashMap;
import java.util.Map;

public class STableUtil {
    public static final Map<String,String> TABLE_PREFIX = new HashMap<String,String>(){{
        put("云","yn");put("京","bj");put("冀","hb");put("吉","jl");
        put("宁","xn");put("川","sc");put("新","xj");put("晋","sx");
        put("桂","gx");put("沪","sh");put("津","tj");put("浙","zj");
        put("渝","cq");put("湘","hn2");put("琼","hn3");put("甘","gs");
        put("皖","ah");put("粤","gd");put("苏","js");put("蒙","nmg");
        put("藏","xz");put("豫","hn");put("贵","gz");put("赣","jx");
        put("辽","ln");put("鄂","hb2");put("闽","fj");put("陕","sx2");
        put("青","qh");put("鲁","sd");put("黑","hlj");
    }};
    public static String getTableName(String plateNo){
        String tablePrefix = TABLE_PREFIX.get(plateNo.substring(0,1));
        if (tablePrefix == null){
            tablePrefix = "defalut";
        }
        return tablePrefix+"_"+plateNo.substring(1).toLowerCase();
    }
}
